<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var greatestLetter = function (s) {
      for (let i = 0; i < 26; i++) {
        const max = String.fromCodePoint('Z'.charCodeAt() - i)
        const min = String.fromCodePoint('z'.charCodeAt() - i)
        if (s.includes(max) && s.includes(min)) {
          return max
        }
      }
      return ''
    };
    console.log(greatestLetter("lEeTcOdE"));
  </script>
</body>

</html>